<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
	    <!-- Loading Bootstrap -->
	    <link href="Public/Admin/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
	    <!-- Loading Flat UI -->
	    <link href="Public/Admin/Flat/dist/css/flat-ui.css" rel="stylesheet">
	    <link href="Public/Admin/Flat/docs/assets/css/demo.css" rel="stylesheet">
	    <link rel="shortcut icon" href="Public/Admin/Flat/img/favicon.ico">
	    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
	    <!--[if lt IE 9]>
	      <script src="dist/js/vendor/html5shiv.js"></script>
	      <script src="dist/js/vendor/respond.min.js"></script>
	    <![endif]-->
	    <script type="text/javascript" src="Public/Admin/jquery-1.8.2.min.js"></script>
	    <style type="text/css">
	    	.ml30{margin-left: 30px;}
	    </style>
	</head>
	<body>
		<!--页面导航-->
		<div class="alert alert-success" role="alert">
			货品管理&nbsp;>&nbsp;编辑货品
		</div>
		<p>
			<a href="<?php echo U('Cargo/index',array('goods_id'=>$oldData['goods_goods_id']))?>" class="btn btn-info btn-sm">返回</a>
		</p>	 	
	<form action="" method="post">
		<input type="hidden" name="cargo_id" value="<?php echo $cargo_id?>" />
		<input type="hidden" name="goods_goods_id" value="<?php echo $goods_id?>" />
		<input type="hidden" name="cargo_sn" value="<?php echo $oldData['cargo_sn']?>" />
		<table class="table table-hover">
			<tr class="active">
			  <th width="100">货品ID</th>
			    <?php if($arr){?>
                
					<?php foreach ($arr as $k=>$v){?>
						<th><?php echo $k?></th>
					<?php }?>
			    
               <?php }?>
			  <th>库存</th>
			  <th>货号</th>
			</tr>
			<tr>
				<td><?php echo $oldData['cargo_id']?></td>
						
				<?php foreach ($arr as $k=>$v){?>
				<td>
					<!--把旧数据里的内容 压成 一维的 与 foreach里的每一项比对 然后设置seleced-->
					<select name="spec[]">
					<option value="">-请选择-</option>
						<?php foreach ($v as $kk=>$vv){?>
							
						<option value="<?php echo $vv['ga_id']?>"
							<?php foreach ($oldData['spec'] as $val){?>
							 <?php if($vv['ga_id']==$val){?>
                selected="selected"
               <?php }?>
							 <?php }?>
							  >
							<?php echo $vv['ga_value']?>
							</option>
							
						<?php }?>
					</select>
				</td>
				<?php }?>
				
				<td><input type="text" name="cargo_number" value="<?php echo $oldData['cargo_number']?>"></td>
				<td><input type="text" name="cargo_sn" disabled value="<?php echo $oldData['cargo_sn']?>" ></td>
			</tr>
			
		</table>
		<button class="btn btn-primary btn-block" type="submit"> 保存修改 </button>
	</form>
	</body>
</html>
